package org.naigu.peach.web.action.user;

import guda.grape.autogen.common.page.BaseQuery;
import guda.grape.autogen.common.page.BizResult;
import guda.grape.util.RequestUtil;
import org.naigu.peach.biz.UserBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by well on 15/10/17.
 */
@Controller
public class UserAction {

    @Autowired
    private UserBiz userBiz;

    @RequestMapping(value = "user/list.htm", method = RequestMethod.GET)
    public String list(HttpServletRequest request, ModelMap modelMap) {
        request.getSession().setAttribute("abc", "123");
        BaseQuery baseQuery = new BaseQuery();
        BizResult list = userBiz.list(baseQuery);
        modelMap.putAll(list.data);
        return RequestUtil.resolveVM(request);
    }
}
